package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.export.AccessOverdueRecordExport;
import com.zhijian.warehouse.manage.entity.export.AccessProductRecordExport;
import com.zhijian.warehouse.manage.entity.po.AccessProductRecord;
import com.zhijian.warehouse.manage.entity.vo.request.AccessProductRecordSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.AccessProductRecordVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface AccessProductRecordMapper {
    int deleteByPrimaryKey(Long id);

    int insert(AccessProductRecord record);

    int insertSelective(AccessProductRecord record);

    AccessProductRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AccessProductRecord record);

    int updateByPrimaryKey(AccessProductRecord record);

    /**
     * 查询总数
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    int count(AccessProductRecordSearchVo accessProductRecordSearchVo);

    /**
     * 查询总数
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    int countDrawBack(AccessProductRecordSearchVo accessProductRecordSearchVo);

    /**
     * 查询列表
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    List<AccessProductRecordVo> selectList(AccessProductRecordSearchVo accessProductRecordSearchVo);

    /**
     * 查询单个
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    AccessProductRecordVo selectOne(AccessProductRecordSearchVo accessProductRecordSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    AccessProductRecordVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    void deleteByCondition(AccessProductRecordSearchVo accessProductRecordSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<AccessProductRecord> entities);

    /**
     * 根据ProductId查询列表
     *
     * @param productId
     * @return
     */
    List<AccessProductRecordVo> selectListByProductId(Long productId);

    /**
     * 根据DrawUserId查询列表
     *
     * @param drawUserId
     * @return
     */
    List<AccessProductRecordVo> selectListByDrawUserId(Long drawUserId);

    /**
     * 根据BackUserId查询列表
     *
     * @param backUserId
     * @return
     */
    List<AccessProductRecordVo> selectListByBackUserId(Long backUserId);

    /**
     *
     * @param day
     * @return
     */
    String selectMaxNumberByDay(String day);

    /**
     * 查询超期列表
     *
     * @param accessProductRecordSearchVo
     * @return
     */
    Integer countOverdue(AccessProductRecordSearchVo accessProductRecordSearchVo);

    List<AccessProductRecordVo> selectOverdueList(AccessProductRecordSearchVo accessProductRecordSearchVo);


    List<AccessProductRecordExport> selectExportList(AccessProductRecordSearchVo accessProductRecordSearchVo);

    List<AccessOverdueRecordExport> selectOverdueExportList(AccessProductRecordSearchVo accessProductRecordSearchVo);
}